home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-05-24 | 358 b | 23 lines | [TEXT/KEEN] |
- #$LineCount: get lines in each input file, and total up at the end
- #Use MFS input option, and show stdout.
-
- FNR == 1{
- if (count+0 > 0)
- {
- print names[n] ":", count
- total += count
- count = 0
- }
- n = split(FILENAME, names, ":")
- }
-
- {++count}
-
- END {
- if (count+0 > 0)
- {
- print names[n] ":", count
- total += count
- }
- print "Total lines:", total
- }